﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list1.aspx.cs" Inherits="CampanyCMS.UI.Admin.OnlineService.list1" %>
<%@ Register TagPrefix="cc1" Namespace="COM.ZTE.TPG.App.UI.WebForm" Assembly="COM.ZTE.TPG.App.UI.WebForm" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>在线客服人员设置</title>
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <link href="../../css/cssCn1.css" type="text/css" rel="stylesheet">
    <link href="../../css/cssCn.css" type="text/css" rel="stylesheet">
    
    <script type="text/javascript">

        $(document).ready(function() {

           
        });
    
        function SelectAll(strGridId) {

            var objCK = document.getElementsByTagName("input");
            var loop;
            var index = 0;
            var objArray = new Array();

            for (loop = 1; loop < objCK.length; loop++) {
                if (objCK[loop].type == "checkbox") {
                    if (objCK[loop].id.indexOf(strGridId) != -1) {
                        objArray[index] = objCK[loop];
                        index++;
                    }
                }
            }
            for (loop = 1; loop < objArray.length; loop++) {
                if (!objArray[loop].disabled) {
                    objArray[loop].click();
                    objArray[loop].checked = objArray[0].checked;
                }
            }
        }
        
        function CheckSelected(strGridId,isdel) {
            var taskIds;
            var check = false;
            var objCK = document.getElementsByTagName("input");
            var loop;
            var index = 0;
            var objArray = new Array();
            for (loop = 1; loop < objCK.length; loop++) {
                if (objCK[loop].type == "checkbox") {
                    if (objCK[loop].id.indexOf(strGridId) != -1) {
                        objArray[index] = objCK[loop];
                        index++;
                    }
                }
            }

            for (loop = 1; loop < objArray.length; loop++) {
                if (objArray[loop].checked) {

                    check = true;
                }
            }
            if (!check) {
                alert('请至少选择一个客服进行操作！');
                return false;
            }
            if (isdel == 1) {
                return confirm("确认要删除你所选择的客服吗？");
            }
        }
 
        
    
    </script>

</head>
<body ms_positioning="GridLayout">
    <form id="Form1" method="post" runat="server">
     <table id="tb_content" cellspacing="0" cellpadding="0" align="center">
        <tbody>
            <tr>
                <td>
                    <table class="tb_searchbar" cellspacing="1" width="100%">
                        <tbody>
                            <tr>
                                <td class="td_head" colspan="2">
                                    <img class="icon" height="13" src="../../img/search1.gif" width="13">
                                    在线客户列表
                                </td>
                            </tr>                             
                            <tr>
                                <td align="right" colspan="2">
                                 <asp:Button ID="btnAdd" runat="server" Text="新增客服"  CssClass="button" 
                                        onclick="btnAdd_Click" />                                    
                                </td>
                            </tr>
                        </tbody>
                    </table>
                       <cc1:ZteGrid ID="dbServices" runat="server" CssClass="tb_datalist" PageChange="TextBox"
                        Width="100%" AllowPaging="True" PageLanguage="Chinese" 
                        IsAllowPaging="True" BorderWidth="0px"
                        CellSpacing="1" AutoGenerateColumns="False" CacheData="ServerCach" SortMode="Total"
                        PageCSS="scrollButton" BorderStyle="Solid" 
                        onitemcommand="dgNews_ItemCommand" onitemdatabound="dgNews_ItemDataBound">
                        <AlternatingItemStyle CssClass="tr_even" BackColor="#F7F9FE"></AlternatingItemStyle>
                        <FooterStyle BackColor="#E8E8E8"></FooterStyle>
                        <ItemStyle BorderColor="White" BackColor="White"></ItemStyle>                   
                   
                        <Columns>
                            <asp:BoundColumn Visible="False" DataField="Base_My_Chat_Tools_ID" HeaderText="Base_My_Chat_Tools_ID"></asp:BoundColumn>
                            <asp:TemplateColumn>
                                <HeaderStyle Width="30px" />
                                <HeaderTemplate>
                                    <asp:CheckBox ID="cbxAll" runat="server" ToolTip="全选/全否选" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbItem" runat="server" /><asp:HiddenField ID="txtSeqno" Value='<%# DataBinder.Eval(Container.DataItem, "Base_My_Chat_Tools_ID") %>'
                                        runat="server" />
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="chat_tool_name" HeaderText="客服类型"></asp:BoundColumn>
                            <asp:BoundColumn DataField="chat_num" HeaderText="帐号"></asp:BoundColumn>                            
                            <asp:BoundColumn DataField="Show_Name" HeaderText="显示名称"></asp:BoundColumn>                            
                             <asp:TemplateColumn  >
                                <HeaderStyle Width="180px"  />
                                <HeaderTemplate>
                                    风格
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Literal ID="lblStyle" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Chat_Style_name") %>'></asp:Literal>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            
                            <asp:TemplateColumn>
                               
                                <HeaderTemplate>
                                    操作
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnDelete" runat="server" CommandName="Remove"   CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Base_My_Chat_Tools_ID") %>' OnClientClick="return confirm('确认删除该客服吗？');">删除该客服</asp:LinkButton>                                   
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle CssClass="tr_title"></HeaderStyle>
                        <SelectedItemStyle CssClass="tr_selected"></SelectedItemStyle>
                        <PagerStyle CssClass="tr_pagenumber"></PagerStyle>
                    </cc1:ZteGrid>
                </td>
            </tr>
        </tbody>
    </table> 
     <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass=button  OnClientClick="return CheckSelected('dbServices',1);"
        onclick="btnDelete_Click" />
    </form>    
</body>
</html>
